<ion-header>
  <ion-navbar>
    <ion-title>发布订单</ion-title>
  </ion-navbar>
</ion-header>
<ion-content>
  <ion-row>
    <ion-col>
      <ion-item-group>
        <ion-item-divider>订单详情</ion-item-divider>
        <ion-item>
          <ion-label>单价:</ion-label>
          <ion-input type="text" placeholder="请输入单价" name="price" [(ngModel)]="orderInfo.price" required></ion-input>
        </ion-item>
        <ion-item>
          <ion-label>数量:</ion-label>
          <ion-input type=" text " placeholder="请输入数量 " name="number " [(ngModel)]="orderInfo.number" required></ion-input>
        </ion-item>
        <ion-item>
          <ion-label>交货时间:</ion-label>
          <ion-datetime displayFormat="YYYY-MM-DD " pickerFormat="YYYY MM DD" [(ngModel)]="orderInfo.deadline" name="deadline"></ion-datetime>
        </ion-item>
        <ion-item>
          <ion-label>服装类型:</ion-label>
          <ion-select placeholder="请选择服装类型" [(ngModel)]="orderInfo.type " name="type">
            <ion-option *ngFor="let item of MainBusiness " value="{{item.value}} ">
              {{item.label}}
            </ion-option>
          </ion-select>
        </ion-item>
        <ion-item>
          <ion-label>工艺要求:</ion-label>
          <ion-input type="text " placeholder="请输入工艺要求" name="required " [(ngModel)]="orderInfo.tech_requirements " required></ion-input>
        </ion-item>
        <ion-item>
          <ion-label>款号:</ion-label>
          <ion-input type="text " placeholder="请输入款号 " name="size" [(ngModel)]="orderInfo.size" required></ion-input>
        </ion-item>
        <ion-item>
          <ion-label>描述:</ion-label>
          <ion-textarea type="text " placeholder="请输入描述" name="desc" [(ngModel)]="orderInfo.desc" required></ion-textarea>
        </ion-item>
        <ion-item *ngFor="let img of imgFiles">
          <img src="{{img}}">
        </ion-item>
        <form id="photoForm" #photoForm="ngForm" enctype="multipart/form-data" action="/api/photo" method="post" target="hiddenFrame">
          <ion-item class="images-upload-container">
            <button class="image-choose" id="img-choose" (click)="fileChoose()">
              <ion-icon name="images"></ion-icon>
            </button>
            <input type="hidden" [(ngModel)]="orderInfo.id" name="id">
            <input type="file" id="images-input" name="files" (change)="fileChange($event)" multiple>
          </ion-item>
          <button id="photoBtn" type="submit" style="display: none;"></button>
        </form>
        <iframe name="hiddenFrame" style="display: none;"></iframe>
      </ion-item-group>
    </ion-col>
  </ion-row>
  <ion-row>
    <ion-col class="signup-col ">
      <button ion-button class="submit-btn " full type="submit"  (click)="orderPublic()">立即发布</button>
    </ion-col>
  </ion-row>
</ion-content>

